package com.ikaros.controller.admin;

import com.ikaros.model.entity.SysUser;
import com.ikaros.service.admin.SysUserService;
import com.ikaros.utils.EhcacheUtil;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by Ikaros on 2017/9/28.
 */
public abstract class AbstractController {
    @Autowired
    protected EhcacheUtil ehcacheUtil;

    protected SysUser getAdmin(){
        SysUser user = (SysUser)SecurityUtils.getSubject().getPrincipal();
        return user;
    }
    protected Long getAdminId(){
        SysUser user = (SysUser)SecurityUtils.getSubject().getPrincipal();
        return user.getUserId();
    }
}
